package com.koron.css2.clientCenter.impl;

import com.koron.css2.ServerInterface;
import com.koron.css2.clientCenter.bean.userGroupUpdateBean;
import com.koron.css2.clientCenter.mapper.UserInfoMapper;
import com.koron.css2.serviceManage.bean.RequestBean;
import com.koron.css2.serviceManage.bean.UserInfoBean;
import com.koron.css2.serviceManage.utils.JsonUtils;
import com.koron.util.Constant;
import org.koron.ebs.mybatis.SessionFactory;
import org.swan.bean.MessageBean;

public class UserGroupNoDel implements ServerInterface{

	@Override
	public MessageBean<?> exec(SessionFactory factory, UserInfoBean userInfo, RequestBean req) {
		// TODO Auto-generated method stub
		MessageBean<String> info = MessageBean.create(Constant.MESSAGE_INT_SUCCESS, "操作失败", String.class);
		try {
			userGroupUpdateBean bean = JsonUtils.objectToPojo(req.getData(), userGroupUpdateBean.class);
			UserInfoMapper uiMapper = factory.getMapper(UserInfoMapper.class);
			uiMapper.updateUserGroupNo(bean);
			
			return info;
		}catch (Exception e) {
			// TODO: handle exception
			logger.error("UserGroupNoDel-操作失败" + e.getMessage(), e);
			return  MessageBean.create(Constant.MESSAGE_INT_FAIL, "操作失败", null);
		}
	}

}
